//
//  HomeAllFunctionController.m
//  Rail
//
//  Created by hychen on 2018/3/13.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "HomeAllFunctionController.h"
#import "HomeCubeView.h"

#import "WatchVideoViewController.h"
#import "CarLogViewController.h"
#import "ObserverLineViewController.h"
#import "FaceGatherViewController.h"
#import "FactoryDetailViewController.h"

#import "CubeJumpTool.h"

@interface HomeAllFunctionController ()
@property (nonatomic, strong) HomeCubeView *cubeView;
@end

@implementation HomeAllFunctionController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.navigationItem addSimpleTitleView:@"全部功能"];
    
    BMWeakSelf
    NSArray *cubeArray = [HomeCubeModel mj_objectArrayWithKeyValuesArray:@[@{@"title":@"视频监控",@"image":@"home_video_surveillance_ic",@"sign":@"videoctrl"},
                                                                           @{@"title":@"设备管理",@"image":@"home_equipment_management_ic",@"sign":@"devicectrl"},
                                                                           @{@"title":@"车辆登记",@"image":@"home_vehicle_registration_ic",@"sign":@"carreg"},
                                                                           @{@"title":@"人脸采集",@"image":@"home_face_collect_ic",@"sign":@"faceget"},
                                                                           @{@"title":@"巡线管理",@"image":@"home_patrol_management_ic",@"sign":@"linectrl"},
                                                                           @{@"title":@"设备领用",@"image":@"home_equipment_receive_ic",@"sign":@"getdevice"},
                                                     ]];

    HomeCubeView *cubeView = [[HomeCubeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, [HomeCubeView heightForCount:cubeArray.count])];
    self.cubeView = cubeView;
    [cubeView setModelArray:cubeArray];
    [cubeView setBlockClickCube:^(NSInteger index, NSString *sign) {
        [weakSelf clickCubeButton:index sign:sign];
    }];
    
    [self.view addSubview:cubeView];
}

#pragma mark 方块点击
- (void)clickCubeButton:(NSInteger)index sign:(NSString *)sign {
    [CubeJumpTool clickCubeButton:index sign:sign];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
